<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>代码复用--原型</title>
		<style>
			table {
				border-spacing: 0px;
				border: 1px solid black;
			}
			
			td {
				width: 80px;
				height: 20px;
				text-align: center;
				border: 1px solid black;
			}
			
			thead {
				background-color: pink;
			}
		</style>
	</head>

	<body>
		<h1>Transform DataGrid from Table</h1>
		<p>Transform DataGrid from an existing, unformatted html table.</p>
		
		<table id="tb" onmouseover="over()" onmouseleave="leave()">
			<thead>
				<td>Item ID</td>
				<td>Product</td>
				<td>List Price</td>
				<td>Attribute</td>
			</thead>

			<tbody id="body">
				<tr>
					<td>EST-1</td>
					<td>FI</td>
					<td>36.50</td>
					<td>Large</td>
				</tr>
				<tr>
					<td>EST-1</td>
					<td>FI</td>
					<td>36.50</td>
					<td>Large</td>
				</tr>
				<tr>
					<td>EST-1</td>
					<td>FI</td>
					<td>36.50</td>
					<td>Large</td>
				</tr>
				<tr>
					<td>EST-1</td>
					<td>FI</td>
					<td>36.50</td>
					<td>Large</td>
				</tr>
				<tr>
					<td>EST-1</td>
					<td>FI</td>
					<td>36.50</td>
					<td>Large</td>
				</tr>
				<tr>
					<td>EST-1</td>
					<td>FI</td>
					<td>36.50</td>
					<td>Large</td>
				</tr>
				<tr>
					<td>EST-1</td>
					<td>FI</td>
					<td>36.50</td>
					<td>Large</td>
				</tr>
				<tr>
					<td>EST-1</td>
					<td>FI</td>
					<td>36.50</td>
					<td>Large</td>
				</tr>
				<tr>
					<td>EST-1</td>
					<td>FI</td>
					<td>36.50</td>
					<td>Large</td>
				</tr>
				<tr>
					<td>EST-1</td>
					<td>FI</td>
					<td>36.50</td>
					<td>Large</td>
				</tr>
				<tr>
					<td>EST-1</td>
					<td>FI</td>
					<td>36.50</td>
					<td>Large</td>
				</tr>
				<tr>
					<td>EST-1</td>
					<td>FI</td>
					<td>36.50</td>
					<td>Large</td>
				</tr>
				<tr>
					<td>EST-1</td>
					<td>FI</td>
					<td>36.50</td>
					<td>Large</td>
				</tr>
				<tr>
					<td>EST-1</td>
					<td>FI</td>
					<td>36.50</td>
					<td>Large</td>
				</tr>
				<tr>
					<td>EST-1</td>
					<td>FI</td>
					<td>36.50</td>
					<td>Large</td>
				</tr>
				<tr>
					<td>EST-1</td>
					<td>FI</td>
					<td>36.50</td>
					<td>Large</td>
				</tr>
				<tr>
					<td>EST-1</td>
					<td>FI</td>
					<td>36.50</td>
					<td>Large</td>
				</tr>
				<tr>
					<td>EST-1</td>
					<td>FI</td>
					<td>36.50</td>
					<td>Large</td>
				</tr>
				<tr>
					<td>EST-1</td>
					<td>FI</td>
					<td>36.50</td>
					<td>Large</td>
				</tr>
				<tr>
					<td>EST-1</td>
					<td>FI</td>
					<td>36.50</td>
					<td>Large</td>
				</tr>
			</tbody>
		</table>

		<script src="oo.js">
			/*var tbody=document.getElementById('boby');
			var trs=tbody.getElementsByTagName('tr');
			
			
			//鼠标移入事件:偶数行：yellow 奇数行gray
			function over(){
				for(var i=0;i<trs.length;i++){
					if(i%2==0){
						trs[i].style.background='yellow';
					}else{
						trs[i].style.background='gray';
					}
				}
			}
			//鼠标移出事件：去除背景颜色
			function leave(){
				for(var i=0;i<trs.length;i++){
					trs[i].style.background='';
				}
			}*/
			
		</script>
		<script src="indexoo.js">
			
		</script>

	</body>

</html>